package com.zmx.base.repository;

import com.zmx.base.entity.BaseMemberCommunityRelation;
import com.zmx.common.common.repository.BaseRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author zhaomxr
 */
public interface BaseMemberCommunityRelationRepository extends BaseRepository<BaseMemberCommunityRelation> {

    @Query(value = "SELECT * FROM base_member_community_relation where is_valid = 1 and member_id = ?1 order by create_time desc limit 1", nativeQuery = true)
    BaseMemberCommunityRelation getByMemberId(Long memberId);
}
